﻿using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Data;
using Microsoft.Practices.Prism.Commands;
using ParaEditor.Common;
using ParaEditor.DAO.ParaDAO;
using ParaEditor.Desktop.Interfaces;
using ParaEditor.Domain.Entities;
using ParaEditor.Infrastructure;

namespace ParaEditor.Desktop.ViewModel
{
    [Export(typeof(IPara4003ViewModel))]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class Para4003ViewModel : ViewModelBase, IPara4003ViewModel
    {
        private Para4003DAO paramDao;
        

        private ICollectionView infoVerList;
        public ICollectionView InfoVerList
        {
            get
            {
                return infoVerList;
            }
            set
            {
                this.infoVerList = value;
                this.RaisePropertyChangedEvent("InfoVerList");
            }
        }

        private ICollectionView paraCollectionDetail;
        public ICollectionView ParaCollectionDetail
        {
            get
            {
                return this.paraCollectionDetail;
            }
            set
            {
                this.paraCollectionDetail = value;
                this.RaisePropertyChangedEvent("ParaCollectionDetail");
            }
        }

        private Visibility editGroupBoxVisible;
        public Visibility EditGroupBoxVisible
        {
            get
            {
                return this.editGroupBoxVisible;
            }
            set
            {
                this.editGroupBoxVisible = value;
                this.RaisePropertyChangedEvent("EditGroupBoxVisible");
            }
        }

        private int areaNo;
        public int AreaNo
        {
            get
            {
                return this.areaNo;
            }
            set
            {
                this.areaNo = value;
                this.RaisePropertyChangedEvent("AreaNo");
            }
        }

        private int val;
        public int Value
        {
            get
            {
                return this.val;
            }
            set
            {
                this.val = value;
                this.RaisePropertyChangedEvent("Value");
            }
        }

        private short recordID;
        public short RecordID
        {
            get
            {
                return this.recordID;
            }
            set
            {
                this.recordID = value;
                this.RaisePropertyChangedEvent("RecordID");
            }
        }

        //Button
        public DelegateCommand AddParamCommand { get; private set; }
        public DelegateCommand DelParamCommand { get; private set; }
        public DelegateCommand SaveParamCommand { get; private set; }
        public DelegateCommand CanclEditParamCommand { get; private set; }
        public DelegateCommand NewVersionCommand { get; private set; }
        public DelegateCommand CopyCurrentVersionCommand { get; private set; }
        

        [ImportingConstructor]
        public Para4003ViewModel()
        {
            
            paramDao = new Para4003DAO();
            InfoVerList = CollectionViewSource.GetDefaultView(paramDao.GetAllVersion());
            if (paramDao.GetAllVersion().Count == 0)
            {
                Microsoft.Windows.Controls.MessageBox.Show("当前参数无任何参数版本");
            }
            InfoVerList.CurrentChanged += InfoVerList_CurrentChanged;

            EditGroupBoxVisible = Visibility.Hidden;

            //Button
            this.AddParamCommand = new DelegateCommand(this.AddParam);
            this.DelParamCommand = new DelegateCommand(this.DelParam);
            this.SaveParamCommand = new DelegateCommand(this.SaveParam);
            this.CanclEditParamCommand = new DelegateCommand(this.CanclEditParam);
            this.NewVersionCommand = new DelegateCommand(this.NewVersion);
            this.CopyCurrentVersionCommand = new DelegateCommand(this.CopyCurrentVersion);
            
        }

        

        private void AddParam()
        {
            if (InfoVerList.CurrentItem == null)
            {
                Microsoft.Windows.Controls.MessageBox.Show("请添加参数版本！才可进行添加");
            }
            else
            {
                EditGroupBoxVisible = Visibility.Visible;
            }
        }

        private void DelParam()
        {
            try
            {
                if (ParaCollectionDetail.CurrentItem != null)
                {
                    ParamDetail param = ParaCollectionDetail.CurrentItem as ParamDetail;
                    short infoVer = param.InfoVer;
                    //查询出Para4003
                    ObservableCollection<Para4003> paramCollection = paramDao.GetObjectByInfoVer(infoVer);
                    if (Microsoft.Windows.Controls.MessageBox.Show("确认删除所选择的参数！", "4003参数", System.Windows.MessageBoxButton.OKCancel, System.Windows.MessageBoxImage.Question) == System.Windows.MessageBoxResult.OK)
                    {
                        //删除
                        ResultValue result = paramDao.DeleteObject(paramCollection[0], paramCollection[0].para4003Pk.infoVer);
                        if (result.Code == 0)
                        {
                            Microsoft.Windows.Controls.MessageBox.Show("删除成功");
                            //刷新
                            InfoVerList = CollectionViewSource.GetDefaultView(paramDao.GetAllVersion());
                            InfoVerList.CurrentChanged += InfoVerList_CurrentChanged;
                            ReflashDataGrid();

                        }
                        else
                        {
                            Microsoft.Windows.Controls.MessageBox.Show("删除失败!发生错误：" + result.Msg);
                        }
                    }
                }
                else
                {
                    Microsoft.Windows.Controls.MessageBox.Show("未选择要删除的参数");
                }
            }
            catch (Exception e)
            {
            }
        }

        private void NewVersion()
        {
            ObservableCollection<int> infoVerCollection = new ObservableCollection<int>();
            infoVerCollection = paramDao.GetAllVersion();
            int newVersion = paramDao.GetMaxID() + 1;
            infoVerCollection.Add(newVersion);
            InfoVerList = CollectionViewSource.GetDefaultView(infoVerCollection);
            InfoVerList.CurrentChanged += InfoVerList_CurrentChanged;
        }

        public void SaveParam()
        {
            if (this.AreaNo > 0 && this.AreaNo < 65)
            {
                Para4003 param = new Para4003();
                Para4003Pk paramPk = new Para4003Pk();

                int tmp = (int)InfoVerList.CurrentItem;
                paramPk.infoVer = Int16.Parse(tmp.ToString());
                paramPk.recordId = this.RecordID;
                param.para4003Pk = paramPk;
                ResultValue result = paramDao.SaveObject(this.AreaNo, this.Value, param);
                if (result.Code == 0)
                {
                    Microsoft.Windows.Controls.MessageBox.Show("保存成功");
                    ReflashDataGrid();

                    CanclEditParam();
                }
                else
                {
                    Microsoft.Windows.Controls.MessageBox.Show("保存失败！发生错误:" + result.Msg);
                }
            }
            else
            {
                Microsoft.Windows.Controls.MessageBox.Show("费率区域编号超出范围");
            }
        }

        private void CopyCurrentVersion()
        {
            //查询当前版本
            ObservableCollection<Para4003> currentVersionParam = new ObservableCollection<Para4003>();
            int infoVer = (int)InfoVerList.CurrentItem;
            currentVersionParam = paramDao.GetObjectByInfoVer(infoVer);

            if (currentVersionParam.Count != 0)
            {
                Para4003 param = null;
                Para4003Pk paramPk = null;
                int newVersion = paramDao.GetMaxID() + 1;
                foreach (Para4003 item in currentVersionParam)
                {
                    paramPk = new Para4003Pk();
                    param = new Para4003(item);
                    paramPk.infoVer = Int16.Parse(newVersion.ToString());
                    paramPk.recordId = item.para4003Pk.recordId;
                    param.para4003Pk = paramPk;
                    ResultValue result = paramDao.CreateObject(param);
                    if (result.Code != 0)
                    {
                        Microsoft.Windows.Controls.MessageBox.Show("复制过程中出现错误!错误信息：" + result.Msg);
                    }
                }
                //刷新

                ObservableCollection<Para4003> paramCollection = paramDao.GetObjectByInfoVer(newVersion);
                if (paramCollection.Count != 0)
                {
                    Para4003 item = paramCollection[0];
                    ParaCollectionDetail = CollectionViewSource.GetDefaultView(ConvertPara4003ToParamDetail(item));
                }
                else
                {
                    ParaCollectionDetail = null;
                }
                InfoVerList = CollectionViewSource.GetDefaultView(paramDao.GetAllVersion());
                InfoVerList.CurrentChanged += InfoVerList_CurrentChanged;
            }
            else
            {
                Microsoft.Windows.Controls.MessageBox.Show("所查询的当前版本没有数据,不可进行复制");
            }
        }

        private void CanclEditParam()
        {
            this.EditGroupBoxVisible = Visibility.Hidden;
            //将控件置为空
            this.Value = 0;
            this.AreaNo = 0;
        }

        private bool Confirm()
        {
            bool flag = true;
            /*
            if (this.LineID != null && !"".Equals(this.LineID) && this.LineNmCn != null && !"".Equals(this.LineNmCn) && !"".Equals(this.LineNmEn) && this.LineNmEn != null)
            {
                flag = true;
            }
            else
            {
                Microsoft.Windows.Controls.MessageBox.Show("所填信息不完整");
                flag = false;
            }
             */
            return flag;
        }

        void InfoVerList_CurrentChanged(object sender, System.EventArgs ep)
        {
            if (InfoVerList.CurrentItem != null)
            {
                ReflashDataGrid();
            }
        }



        private void ReflashDataGrid()
        {
            int infoVer = (int)InfoVerList.CurrentItem;
            ObservableCollection<Para4003> paramCollection = paramDao.GetObjectByInfoVer(infoVer);
            if (paramCollection.Count != 0)
            {
                Para4003 item = paramCollection[0];
                ParaCollectionDetail = CollectionViewSource.GetDefaultView(ConvertPara4003ToParamDetail(paramCollection));
            }
            else
            {
                ParaCollectionDetail = null;
            }
        }

        class ParamDetail
        {
            public ParamDetail(short infoVer,int areaNo,int val,short recordID)
            {
                InfoVer = infoVer;
                AreaNo = areaNo;
                Value = val;
                RecordID = recordID;
            }

            public short InfoVer { get; set; }
            public short RecordID { get; set; }
            public int AreaNo { get; set; }
            public int Value { get; set; }
        }

        private ObservableCollection<ParamDetail> ConvertPara4003ToParamDetail(ObservableCollection<Para4003> paramCollection)
        {
            ObservableCollection<ParamDetail> paramDetailCollection = new ObservableCollection<ParamDetail>();
            foreach (Para4003 param in paramCollection)
            {
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 1, param.rate1, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 2, param.rate2, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 3, param.rate3, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 4, param.rate4, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 5, param.rate5, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 6, param.rate6, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 7, param.rate7, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 8, param.rate8, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 9, param.rate9, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 10, param.rate10, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 11, param.rate11, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 12, param.rate12, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 13, param.rate13, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 14, param.rate14, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 15, param.rate15, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 16, param.rate16, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 17, param.rate17, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 18, param.rate18, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 19, param.rate19, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 20, param.rate20, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 21, param.rate21, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 22, param.rate22, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 23, param.rate23, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 24, param.rate24, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 25, param.rate25, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 26, param.rate26, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 27, param.rate27, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 28, param.rate28, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 29, param.rate29, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 30, param.rate30, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 31, param.rate31, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 32, param.rate32, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 33, param.rate33, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 34, param.rate34, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 35, param.rate35, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 36, param.rate36, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 37, param.rate37, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 38, param.rate38, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 39, param.rate39, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 40, param.rate40, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 41, param.rate41, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 42, param.rate42, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 43, param.rate43, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 44, param.rate44, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 45, param.rate45, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 46, param.rate46, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 47, param.rate47, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 48, param.rate48, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 49, param.rate49, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 50, param.rate50, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 51, param.rate51, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 52, param.rate52, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 53, param.rate53, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 54, param.rate54, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 55, param.rate55, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 56, param.rate56, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 57, param.rate57, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 58, param.rate58, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 59, param.rate59, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 60, param.rate60, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 61, param.rate61, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 62, param.rate62, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 63, param.rate63, param.para4003Pk.recordId));
                paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 64, param.rate64, param.para4003Pk.recordId));
            }
            return paramDetailCollection;
        }

        private ObservableCollection<ParamDetail> ConvertPara4003ToParamDetail(Para4003 param)
        {
            ObservableCollection<ParamDetail> paramDetailCollection = new ObservableCollection<ParamDetail>();
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 1, param.rate1, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 2, param.rate2, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 3, param.rate3, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 4, param.rate4, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 5, param.rate5, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 6, param.rate6, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 7, param.rate7, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 8, param.rate8, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 9, param.rate9, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 10, param.rate10, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 11, param.rate11, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 12, param.rate12, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 13, param.rate13, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 14, param.rate14, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 15, param.rate15, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 16, param.rate16, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 17, param.rate17, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 18, param.rate18, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 19, param.rate19, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 20, param.rate20, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 21, param.rate21, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 22, param.rate22, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 23, param.rate23, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 24, param.rate24, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 25, param.rate25, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 26, param.rate26, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 27, param.rate27, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 28, param.rate28, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 29, param.rate29, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 30, param.rate30, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 31, param.rate31, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 32, param.rate32, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 33, param.rate33, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 34, param.rate34, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 35, param.rate35, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 36, param.rate36, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 37, param.rate37, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 38, param.rate38, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 39, param.rate39, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 40, param.rate40, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 41, param.rate41, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 42, param.rate42, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 43, param.rate43, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 44, param.rate44, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 45, param.rate45, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 46, param.rate46, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 47, param.rate47, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 48, param.rate48, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 49, param.rate49, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 50, param.rate50, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 51, param.rate51, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 52, param.rate52, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 53, param.rate53, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 54, param.rate54, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 55, param.rate55, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 56, param.rate56, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 57, param.rate57, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 58, param.rate58, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 59, param.rate59, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 60, param.rate60, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 61, param.rate61, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 62, param.rate62, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 63, param.rate63, param.para4003Pk.recordId));
            paramDetailCollection.Add(new ParamDetail(param.para4003Pk.infoVer, 64, param.rate64, param.para4003Pk.recordId));
            return paramDetailCollection;
        }
    }
}
